<!DOCTYPE html>
<html>
<head>
<title>矿机表</title> <#include "/header.html">
<script src="${request.contextPath}/statics/libs/ajaxupload.js"></script>
</head>
<body>
	<div id="rrapp" v-cloak>
		<div v-show="showList">
			<div class="grid-btn">
				<#if shiro.hasPermission("aic:machine:save")>
				<a class="btn btn-primary" @click="add">
					<i class="fa fa-plus"></i>&nbsp;添加矿机
				</a>
				</#if> <#if shiro.hasPermission("aic:machine:update")>
				<a class="btn btn-primary" @click="update">
					<i class="fa fa-pencil-square-o"></i>&nbsp;修改矿机
				</a>
				<a class="btn btn-primary" @click="changeStatus(0)">
					<i class="fa fa-angle-up"></i>&nbsp;上架
				</a>
				<a class="btn btn-primary" @click="changeStatus(1)">
					<i class="fa fa-angle-down"></i>&nbsp;下架
				</a>
				</#if>
			</div>
			<table id="jqGrid"></table>
			<div id="jqGridPager"></div>
		</div>

		<div v-show="!showList" class="panel panel-default">
			<div class="panel-heading">{{title}}</div>
			<form class="form-horizontal">
				<div class="form-group">
					<div class="col-sm-2 control-label">矿机名称</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="machine.machineName" placeholder="矿机名称" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">矿机类型</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="machine.machineType">
							<option v-for="item in machineType" :value=item.code>{{item.value}}</option>
						</select>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">矿机价格</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="machine.price" placeholder="矿机价格" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">算力</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="machine.hashSecond" placeholder="算力  GH/s" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">总运行天数</div>
					<div class="col-sm-10">
						<input type="number" class="form-control" min="1" v-model="machine.totalDays"
							placeholder="矿机运行天数" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">每日收益</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="machine.dayProfit" placeholder="每日收益" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">库存(-1:无限)</div>
					<div class="col-sm-10">
						<input type="text" class="form-control" v-model="machine.stock" placeholder="库存" />
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">矿机图片</div>
					<div class="col-sm-10">
						<input type="hidden" v-model="machine.machineImg" />
						<a class="btn btn-primary upload" id="machineImg">
							<i class="fa fa-pencil-square-o"></i>&nbsp;上传
						</a>
						<div class="row" v-show="machine.machineImg && machine.machineImg!=''">
							<div class="col-md-8">
								<a :href="machine.machineImg" target="_blank" class="thumbnail">
									<img :src="machine.machineImg" width="150px" height="150px">
								</a>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<div class="col-sm-2 control-label">状态</div>
					<div class="col-sm-10">
						<select class="form-control" v-model="machine.status">
							<option value="0">上架</option>
							<option value="1">下架</option>
						</select>
					</div>
				</div>

				<div class="form-group">
					<div class="col-sm-2 control-label"></div>
					<input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定" />
					&nbsp;&nbsp;
					<input type="button" class="btn btn-warning" @click="reload" value="返回" />
				</div>
			</form>
		</div>
	</div>
	</div>

	<script src="${request.contextPath}/statics/js/modules/aic/machine.js?_${.now?long}"></script>
</body>
</html>